/**
 * 
 */
package com.habitsoft.glassfish.dashboard.server;

import java.util.regex.Pattern;

public class RegexFilter implements LogFilter {
    final Pattern pattern;
    
    public RegexFilter(String pattern) {
        this.pattern = Pattern.compile(pattern, Pattern.CASE_INSENSITIVE|Pattern.MULTILINE|Pattern.DOTALL);
    }
    
    @Override
    public boolean matches(String log) {
        return pattern.matcher(log).find();
    }
}